home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / macros / plain / contrib / blanks.tex < prev    next >
Encoding:
Text File  |  1992-08-26  |  1.3 KB  |  35 lines

  1. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  2. %               Fill-in-the-blank macros
  3. %                     Hal Varian
  4. %                   August 19, 1987
  5. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  6.      
  7.      
  8. %list processing routines taken from TeXbook, p. 310-11
  9.      
  10. \def\dolist{\afterassignment\dodolist\let\next= }
  11. \def\dodolist{\ifx\next\endlist \let\next\relax
  12.   \else \\\let\next\dolist \fi
  13.   \next}
  14. \def\endlist{\endlist}
  15.      
  16. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  17.      
  18. %print out answers or not?
  19. \newif\ifDoAnswers\DoAnswerstrue
  20.      
  21. %See if next token is a space.  If it is, set a low penalty for
  22. %line breaking.  Set box 0 to be the next token.  If we should
  23. %do answers, underscore box 0, back up and print box 0.  Otherwise
  24. %just underscore box 0.
  25. \def\\{\expandafter\if\space\next\penalty0\fi\setbox0=\hbox{\next}\ifDoAnswers
  26.   \underscore\llap{\raise2pt\box0}\else\underscore\fi}
  27.      
  28. %Underscore -- put in strut so there is enough space for handwriting.
  29. \def\underscore{\bigstrut\vrule height 0pt depth.5pt width\wd0}
  30. \def\bigstrut{\hbox{\vrule height 16pt width 0pt}}
  31.      
  32. \def\Ans#1{\space{\AnsFont {\dolist#1\endlist}\underscore}}
  33.  
  34. %%% ----cutting here would not be a bad idea-----------------------
  35.